exec_pod(){
cmd="kubectl exec -n liuxz -ti $1 -- /bin/bash"
echo $cmd
$cmd
}

print_loss1(){
pod_prefix=$1
num=`kubectl get pod -n liuxz| grep $pod_prefix | wc -l`
echo $num
for(( i = 0; i <= $num-1 ; i = i + 1 ))
do
	echo $pod_prefix-$i
	kubectl logs -n liuxz $pod_prefix-$i | grep "loss:"|grep -v "loss: 0" | tail -n 3 | grep "loss:" 
done
}

# print loss,param1: job_prefix
print_loss(){
pod_prefix=$1
num=`kubectl get pod -n liuxz| grep $pod_prefix | wc -l`
echo $num
for(( i = 0; i <= $num-1 ; i = i + 1 ))
do
res=`kubectl logs -n liuxz $pod_prefix-$i | grep "loss:"|grep -v "loss: 0" | tail -n 2 | grep "loss:"`
if test ! -z "${res}"; then
	echo $pod_prefix-$i
	kubectl logs -n liuxz $pod_prefix-$i
	echo $pod_prefix-$i
	break
fi
done
}
